<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets">
	
	<ui:composition template="/WEB-INF/templates/default.xhtml">
			<ui:define name="pageTitle">Regions</ui:define>
			<ui:define name="pageHeader">Create Region</ui:define>
			<ui:define name="message">Enter the details - <br/> <h:messages globalOnly="true"/></ui:define>
			<ui:define name="addLink"><!-- <h:outputLink value="#" >Create New Region</h:outputLink> --></ui:define>
			<ui:define name="body">
				<f:metadata>
					<f:event listener="#{regionController.initNewRegion()}" type="preRenderView" />
				</f:metadata>				
				<h:form>				
					<h:panelGrid columns="2">
						<h:outputLabel for="region" value="Name:" />
						<h:inputText id="region" value="#{editedRegion.regionName}" />
						<h:message for="region" errorClass="invalid" />						
					</h:panelGrid>
					<h:commandButton action="#{regionController.saveRegion(editedRegion)}" value="Save" />					
				</h:form>
			</ui:define>
	</ui:composition>

</html>